<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Product extends D_Controller {

	/**
	 * 初始化
	 */
	public function __construct(){
		parent::__construct();
	}

	/**
	 * 商品详情主页
	 * @param  integer $pid 商品id
	 * @return null
	 */
	public function index($pid = -1){
		if($pid == -1){
			show_404();
		} 
		
		$this->load->model('m_product');
		$data = $this->m_product->get_product_info($pid);
		$data['options'] = $this->m_product->get_product_attributes($pid);

		//var_dump($data);

		//echo $this->session->userdata('language_id');
		
		$this->load->view_tpls('v_product', $data);
	}
	
	public function addCart(){
	    echo 'add success....';
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */